package com.suxin.plugin.intergration.application;

import com.suxin.plugin.listener.PluginInitializerListener;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/**
 * @author Tang
 * @classname AutoPluginApplication
 * @description [  ]
 * @date 2022/6/26 22:48
 */
public class AutoPluginApplication extends DefaultPluginApplication
        implements InitializingBean, ApplicationContextAware {

    private ApplicationContext applicationContext;

    private PluginInitializerListener initializerListener;

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.applicationContext = applicationContext;
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        super.initialize(applicationContext);
    }

    @Override
    public void initialize(ApplicationContext applicationContext) {
        throw new ExceptionInInitializerError("InInitializerError...");
    }
}